import { useParams } from 'react-router-dom';

import VulnerableTemplate from '@/components/VulnerableTemplate';

import FileDownload from './level/FileDownload';
import FileUpload from './level/FileUpload';

const File = () => {
  const { level } = useParams();
  const levelMap: any = {
    upload: FileUpload,
    download: FileDownload,
  };

  return <VulnerableTemplate {...levelMap[level!]} />;
};

export default File;
